package exception;

public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println(test("a")+","+test(null)+","+test(""));
    }
    public static int test(String s) {
        try {
            return s.charAt(0)-'a';
        } catch (NullPointerException e) {
            return 1;
        } catch (Exception e) {
            return 2;
        }
    }
}
